//
//  XYAtttributeLabel.h
//  PeiJue
//
//  Created by lxy on 2018/3/1.
//  Copyright © 2018年 lixiya. All rights reserved.
//  富文本

#import <UIKit/UIKit.h>

typedef NS_ENUM(NSInteger, XYAtttributeLabelLinkType) {
    XYAtttributeLabelLinkTypeNone = 0,
    
    XYAtttributeLabelLinkTypeAt,//@
    XYAtttributeLabelLinkTypeJing,//#
    XYAtttributeLabelLinkTypeUrl,//url
    XYAtttributeLabelLinkTypeCustom//自定义
};

@class XYAtttributeLabel;
@protocol XYAtttributeLabelDeleagte <NSObject>
/** 点击链接文本回调 */
- (void)atttributeLabel:(XYAtttributeLabel *)label didSelectedLinkText:(NSString *)linkText linkRange:(NSRange)linkRange linkType:(XYAtttributeLabelLinkType)linkType;
@end


@interface XYAtttributeLabel : UILabel
@property(nonatomic, weak) id<XYAtttributeLabelDeleagte> delegate;

/** 默认文本颜色 */
@property(nonatomic, strong) UIColor *customTextColor;

/** 富文本颜色 */
@property(nonatomic, strong) UIColor *linkTextColor;

/** 富文本选中背景颜色 */
@property(nonatomic, strong) UIColor *linkSelectedBgColor;

/** 添加自动义字段 */
- (void)addCustomLinkWithString:(NSString *)linkText linkRange:(NSRange)linkRange;

@end
